<template>
	<view class="list u-flex" @click="goDeviceDetail">
		<view class="list-left u-margin-right-30">
			<image v-if="item.dkmrtp" :src="$baseUrl + item.dkmrtp" mode="heightFix"></image>
			<image v-if="item.img" :src="$baseUrl + item.img" mode="heightFix"></image>
		</view>
		<view class="list-right u-flex u-row-between">
			<view class="title">
				{{item.title}}
			</view>
			<view class="time-look u-flex u-row-between">
				<view class="time">
					{{$u.timeFormat(item._createtime, 'yyyy-mm-dd  hh:MM')}}
				</view>
				<view v-if="isDel" class="look u-flex u-col-center u-row-center" @click.stop="del">
					删除
				</view>
				<view v-else class="look u-flex u-col-center u-row-center" @click.stop="goDetail">
					查看
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				$baseUrl:""
			}
		},
		created(){
			this.$baseUrl = this.baseUrl
		},
		props:{
			item:{
				type:Object,
				default:{}
			},
			isDel:{
				type:Boolean,
				default:false
			}
		},
		methods:{
			goDetail(){
				this.$emit('goDetail',this.item)
			},
			del(){
				this.$emit('del',this.item)
			},
			goDeviceDetail(){
				this.$emit('goDeviceDetail',this.item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.list{
		width: 100%;
		height: 148rpx;
		margin: 37rpx 0;
		.list-left{
			width: 250rpx;
			height: 148rpx;
			text-align: center;
			overflow: hidden;
			border-radius: 16rpx;
			border: 1rpx solid #dfdfdf;
			image{
				width: 250rpx;
				height: 148rpx;
			}
		}
		.list-right{
			flex-direction: column;
			height: 100%;
			flex: 1;
			.title{
				font-size: 30rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp:2;
				-webkit-box-orient: vertical;
				line-height: 46rpx;
				width: 100%;
				flex: 1;
			}
			.time-look{
				width: 100%;
				.time{
					font-size: 24rpx;
					color: #a6a6a6;
				}
				.look{
					width: 127rpx;
					height: 54rpx;
					border-radius: 54rpx;
					background-color: #feede6;
					font-size: 24rpx;
					color: #c40200;
				}
			}
		}
	}
</style>
